<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<meta name="generator" content="JsDoc Toolkit" />
		
		<title>JsDoc Reference - pwlib</title>

		<style type="text/css">
			/* default.css */
body
{
	font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
	width: 800px;
}

.header
{
	clear: both;
	background-color: #ccc;
	padding: 8px;
}

h1
{
	font-size: 150%;
	font-weight: bold;
	padding: 0;
	margin: 1em 0 0 .3em;
}

hr
{
	border: none 0;
	border-top: 1px solid #7F8FB1;
	height: 1px;
}

pre.code
{
	display: block;
	padding: 8px;
	border: 1px dashed #ccc;
}

#index
{
	margin-top: 24px;
	float: left;
	width: 160px;
	position: absolute;
	left: 8px;
	background-color: #F3F3F3;
	padding: 8px;
}

#content
{
	margin-left: 190px;
	width: 600px;
}

.classList
{
	list-style-type: none;
	padding: 0;
	margin: 0 0 0 8px;
	font-family: arial, sans-serif;
	font-size: 1em;
	overflow: auto;
}

.classList li
{
	padding: 0;
	margin: 0 0 8px 0;
}

.summaryTable { width: 100%; }

h1.classTitle
{
	font-size:170%;
	line-height:130%;
}

h2 { font-size: 110%; }
caption, div.sectionTitle
{
	background-color: #7F8FB1;
	color: #fff;
	font-size:130%;
	text-align: left;
	padding: 2px 6px 2px 6px;
	border: 1px #7F8FB1 solid;
}

div.sectionTitle { margin-bottom: 8px; }
.summaryTable thead { display: none; }

.summaryTable td
{
	vertical-align: top;
	padding: 4px;
	border-bottom: 1px #7F8FB1 solid;
	border-right: 1px #7F8FB1 solid;
}

/*col#summaryAttributes {}*/
.summaryTable td.attributes
{
	border-left: 1px #7F8FB1 solid;
	width: 140px;
	text-align: right;
}

td.attributes, .fixedFont
{
	line-height: 15px;
	color: #002EBE;
	font-family: "Courier New",Courier,monospace;
	font-size: 13px;
}

.summaryTable td.nameDescription
{
	text-align: left;
	font-size: 13px;
	line-height: 15px;
}

.summaryTable td.nameDescription, .description
{
	line-height: 15px;
	padding: 4px;
	padding-left: 4px;
}

.summaryTable { margin-bottom: 8px; }

ul.inheritsList
{
	list-style: square;
	margin-left: 20px;
	padding-left: 0;
}

.detailList {
	margin-left: 20px; 
	line-height: 15px;
}
.detailList dt { margin-left: 20px; }

.detailList .heading
{
	font-weight: bold;
	padding-bottom: 6px;
	margin-left: 0;
}

.light, td.attributes, .light a:link, .light a:visited
{
	color: #777;
	font-style: italic;
}

.fineprint
{
	text-align: right;
	font-size: 10px;
}
		</style>
	</head>

	<body>
<!-- ============================== header ================================= -->	
		<!-- begin static/header.html -->
		<div id="header">
</div>
		<!-- end static/header.html -->

<!-- ============================== classes index ============================ -->
		<div id="index">
			<!-- begin publish.classesIndex -->
			<div align="center"><a href="../index.html">Class Index</a>
| <a href="../files.html">File Index</a></div>
<hr />
<h2>Classes</h2>
<ul class="classList">
	
	<li><i><a href="../symbols/_global_.html">_global_</a></i></li>
	
	<li><a href="../symbols/PaintWeb.html">PaintWeb</a></li>
	
	<li><a href="../symbols/pwlib.html">pwlib</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.html">pwlib.appEvent</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.appDestroy.html">pwlib.appEvent.appDestroy</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.appInit.html">pwlib.appEvent.appInit</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.canvasSizeChange.html">pwlib.appEvent.canvasSizeChange</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.clipboardUpdate.html">pwlib.appEvent.clipboardUpdate</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.commandRegister.html">pwlib.appEvent.commandRegister</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.commandUnregister.html">pwlib.appEvent.commandUnregister</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.configChange.html">pwlib.appEvent.configChange</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.extensionRegister.html">pwlib.appEvent.extensionRegister</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.extensionUnregister.html">pwlib.appEvent.extensionUnregister</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.guiFloatingPanelStateChange.html">pwlib.appEvent.guiFloatingPanelStateChange</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.guiHide.html">pwlib.appEvent.guiHide</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.guiResizeEnd.html">pwlib.appEvent.guiResizeEnd</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.guiResizeMouseMove.html">pwlib.appEvent.guiResizeMouseMove</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.guiResizeStart.html">pwlib.appEvent.guiResizeStart</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.guiShow.html">pwlib.appEvent.guiShow</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.guiTabActivate.html">pwlib.appEvent.guiTabActivate</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.historyUpdate.html">pwlib.appEvent.historyUpdate</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.imageCrop.html">pwlib.appEvent.imageCrop</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.imageSave.html">pwlib.appEvent.imageSave</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.imageSaveResult.html">pwlib.appEvent.imageSaveResult</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.imageSizeChange.html">pwlib.appEvent.imageSizeChange</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.imageZoom.html">pwlib.appEvent.imageZoom</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.selectionChange.html">pwlib.appEvent.selectionChange</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.shadowAllow.html">pwlib.appEvent.shadowAllow</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.toolActivate.html">pwlib.appEvent.toolActivate</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.toolPreactivate.html">pwlib.appEvent.toolPreactivate</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.toolRegister.html">pwlib.appEvent.toolRegister</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.toolUnregister.html">pwlib.appEvent.toolUnregister</a></li>
	
	<li><a href="../symbols/pwlib.appEvent.viewportSizeChange.html">pwlib.appEvent.viewportSizeChange</a></li>
	
	<li><a href="../symbols/pwlib.appEvents.html">pwlib.appEvents</a></li>
	
	<li><a href="../symbols/pwlib.browser.html">pwlib.browser</a></li>
	
	<li><a href="../symbols/pwlib.dom.html">pwlib.dom</a></li>
	
	<li><a href="../symbols/pwlib.dom.KeyboardEventListener.html">pwlib.dom.KeyboardEventListener</a></li>
	
	<li><a href="../symbols/pwlib.dom.keyCodes.html">pwlib.dom.keyCodes</a></li>
	
	<li><a href="../symbols/pwlib.dom.keyCodes_fixes.html">pwlib.dom.keyCodes_fixes</a></li>
	
	<li><a href="../symbols/pwlib.dom.keyCodes_Safari2.html">pwlib.dom.keyCodes_Safari2</a></li>
	
	<li><a href="../symbols/pwlib.dom.keyNames.html">pwlib.dom.keyNames</a></li>
	
	<li><a href="../symbols/pwlib.extensions.html">pwlib.extensions</a></li>
	
	<li><a href="../symbols/pwlib.extensions.colormixer.html">pwlib.extensions.colormixer</a></li>
	
	<li><a href="../symbols/pwlib.extensions.moodle.html">pwlib.extensions.moodle</a></li>
	
	<li><a href="../symbols/pwlib.extensions.mousekeys.html">pwlib.extensions.mousekeys</a></li>
	
	<li><a href="../symbols/pwlib.fileCache.html">pwlib.fileCache</a></li>
	
	<li><a href="../symbols/pwlib.gui.html">pwlib.gui</a></li>
	
	<li><a href="../symbols/pwlib.guiColorInput.html">pwlib.guiColorInput</a></li>
	
	<li><a href="../symbols/pwlib.guiFloatingPanel.html">pwlib.guiFloatingPanel</a></li>
	
	<li><a href="../symbols/pwlib.guiResizer.html">pwlib.guiResizer</a></li>
	
	<li><a href="../symbols/pwlib.guiTabPanel.html">pwlib.guiTabPanel</a></li>
	
	<li><a href="../symbols/pwlib.tools.html">pwlib.tools</a></li>
	
	<li><a href="../symbols/pwlib.tools.bcurve.html">pwlib.tools.bcurve</a></li>
	
	<li><a href="../symbols/pwlib.tools.cbucket.html">pwlib.tools.cbucket</a></li>
	
	<li><a href="../symbols/pwlib.tools.cpicker.html">pwlib.tools.cpicker</a></li>
	
	<li><a href="../symbols/pwlib.tools.ellipse.html">pwlib.tools.ellipse</a></li>
	
	<li><a href="../symbols/pwlib.tools.eraser.html">pwlib.tools.eraser</a></li>
	
	<li><a href="../symbols/pwlib.tools.hand.html">pwlib.tools.hand</a></li>
	
	<li><a href="../symbols/pwlib.tools.insertimg.html">pwlib.tools.insertimg</a></li>
	
	<li><a href="../symbols/pwlib.tools.line.html">pwlib.tools.line</a></li>
	
	<li><a href="../symbols/pwlib.tools.pencil.html">pwlib.tools.pencil</a></li>
	
	<li><a href="../symbols/pwlib.tools.polygon.html">pwlib.tools.polygon</a></li>
	
	<li><a href="../symbols/pwlib.tools.rectangle.html">pwlib.tools.rectangle</a></li>
	
	<li><a href="../symbols/pwlib.tools.selection.html">pwlib.tools.selection</a></li>
	
	<li><a href="../symbols/pwlib.tools.text.html">pwlib.tools.text</a></li>
	
</ul>
<hr />
			<!-- end publish.classesIndex -->
		</div>
		
		<div id="content">
<!-- ============================== class title ============================ -->
			<h1 class="classTitle">
				
				Namespace pwlib
			</h1>

<!-- ============================== class summary ========================== -->			
			<p class="description">
				
			
				Holds methods and properties necessary throughout the entire 
application.
				
				
					<br /><i>Defined in: </i> <a href="../symbols/src/src_includes_lib.js.html">lib.js</a>.
				
			</p>

<!-- ============================== constructor summary ==================== -->			
			
			<table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class pwlib.">
				<caption>Namespace Summary</caption>
				<thead>
					<tr>
						<th scope="col">Constructor Attributes</th>
						<th scope="col">Constructor Name and Description</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td class="attributes">&nbsp;</td>
						<td class="nameDescription" >
							<div class="fixedFont">
								<b><a href="../symbols/pwlib.html#constructor">pwlib</a></b>
							</div>
							<div class="description"></div>
						</td>
					</tr>
				</tbody>
			</table>
			

<!-- ============================== properties summary ===================== -->
			
				
				
				
				
			

<!-- ============================== methods summary ======================== -->
			
				
				
				<table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class pwlib.">
					<caption>Method Summary</caption>
					<thead>
						<tr>
							<th scope="col">Method Attributes</th>
							<th scope="col">Method Name and Description</th>
						</tr>
					</thead>
					<tbody>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">pwlib.<b><a href="../symbols/pwlib.html#.extend">extend</a></b>(overwrite, destination, source)
								</div>
								<div class="description">This function extends objects.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">pwlib.<b><a href="../symbols/pwlib.html#.isSameHost">isSameHost</a></b>(url, host)
								</div>
								<div class="description">Check if an URL points to a resource from the same host as the desired one.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">pwlib.<b><a href="../symbols/pwlib.html#.jsonParse">jsonParse</a></b>(str)
								</div>
								<div class="description">Parse a JSON string.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">pwlib.<b><a href="../symbols/pwlib.html#.strf">strf</a></b>(str, vars)
								</div>
								<div class="description">Retrieve a string formatted with the provided variables.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&lt;static&gt; &nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">pwlib.<b><a href="../symbols/pwlib.html#.xhrLoad">xhrLoad</a></b>(url, handler, method, send, headers)
								</div>
								<div class="description">Load a file from a given URL using XMLHttpRequest.</div>
							</td>
						</tr>
					
					</tbody>
				</table>
				
				
				
			
<!-- ============================== events summary ======================== -->
			

<!-- ============================== constructor details ==================== -->		
			
			<div class="details"><a name="constructor"> </a>
				<div class="sectionTitle">
					Namespace Detail
				</div>
				
				<div class="fixedFont">
						<b>pwlib</b>
				</div>
				
				<div class="description">
					
					
				</div>
				
				
				
				
					
					
					
					
					
					
					

			</div>
			

<!-- ============================== field details ========================== -->		
			

<!-- ============================== method details ========================= -->		
			
				<div class="sectionTitle">
					Method Detail
				</div>
				
					<a name=".extend"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					
					<span class="light">pwlib.</span><b>extend</b>(overwrite, destination, source)
					
					</div>
					<div class="description">
						This function extends objects.
						
						
					</div>
					
					
					
					<pre class="code"><code>var <var>obj1</var> = {a: 'a1', b: 'b1', d: 'd1'},
    <var>obj2</var> = {a: 'a2', b: 'b2', c: 'c2'};

pwlib.extend(<var>obj1</var>, <var>obj2</var>);</code>

// Now <var>obj1.c == 'c2'</var>, while <var>obj1.a</var>, <var>obj1.b</var>
// and <var>obj1.d</var> remain the same.

// If <code>pwlib.extend(true, <var>obj1</var>, <var>obj2</var>)</code> is
// called, then <var>obj1.a</var>, <var>obj1.b</var>, <var>obj1.c</var>
// become all the same as in <var>obj2</var>.</pre>
					
					<pre class="code"><code>var <var>obj1</var> = {a: 'a1', b: 'b1', extend: pwlib.extend};
<var>obj1</var>.extend({c: 'c1', d: 'd1'});</code>

// In this case the destination object which is to be extend is
// <var>obj1</var>.</pre>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{Boolean}</span> <b>overwrite</b>
									<i>Optional, Default: false</i>
								</dt>
								<dd>If the first argument is a boolean, then 
it will be considered as a boolean flag for overwriting (or not) any existing 
methods and properties in the destination object. Thus, any method and 
property from the source object will take over those in the destination. The 
argument is optional, and if it's omitted, then no method/property will be 
overwritten.</dd>
							
								<dt>
									<span class="light fixedFont">{Object}</span> <b>destination</b>
									<i>Optional, Default: this</i>
								</dt>
								<dd>The second argument is the optional 
destination object: the object which will be extended. By default, the 
<var>this</var> object will be extended.</dd>
							
								<dt>
									<span class="light fixedFont">{Object}</span> <b>source</b>
									
								</dt>
								<dd>The third argument must provide list of methods and 
properties which will be added to the destination object.</dd>
							
							</dl>
						
						
						
						
						
						
						

					<hr />
				
					<a name=".isSameHost"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					<span class="light">{Boolean}</span>
					<span class="light">pwlib.</span><b>isSameHost</b>(url, host)
					
					</div>
					<div class="description">
						Check if an URL points to a resource from the same host as the desired one.

<p>Note that data URIs always return true.
						
						
					</div>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>url</b>
									
								</dt>
								<dd>The URL you want to check.</dd>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>host</b>
									
								</dt>
								<dd>The host you want in the URL. The host name can include 
the port definition as well.</dd>
							
							</dl>
						
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd><span class="light fixedFont">{Boolean}</span> True if the <var>url</var> points to a resource from the 
<var>host</var> given, or false otherwise.</dd>
							
							</dl>
						
						
						

					<hr />
				
					<a name=".jsonParse"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					
					<span class="light">pwlib.</span><b>jsonParse</b>(str)
					
					</div>
					<div class="description">
						Parse a JSON string. This method uses the global JSON parser provided by 
the browser natively. The small difference is that this method allows 
normal JavaScript comments in the JSON string.
						
						
					</div>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>str</b>
									
								</dt>
								<dd>The JSON string to parse.</dd>
							
							</dl>
						
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd>The JavaScript object that was parsed.</dd>
							
							</dl>
						
						
						

					<hr />
				
					<a name=".strf"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					<span class="light">{String}</span>
					<span class="light">pwlib.</span><b>strf</b>(str, vars)
					
					</div>
					<div class="description">
						Retrieve a string formatted with the provided variables.

<p>The language string must be available in the global <var>lang</var> 
object.

<p>The string can contain any number of variables in the form of 
<code>{var_name}</code>.
						
						
					</div>
					
					
					
					<pre class="code">lang.table_cells = "The table {name} has {n} cells.";

// later ...
console.log(pwlib.strf(lang.table_cells, {'name' : 'tbl1', 'n' : 11}));
// The output is 'The table tbl1 has 11 cells.'</pre>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>str</b>
									
								</dt>
								<dd>The string you want to output.</dd>
							
								<dt>
									<span class="light fixedFont">{Object}</span> <b>vars</b>
									<i>Optional</i>
								</dt>
								<dd>The variables you want to set in the language string.</dd>
							
							</dl>
						
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd><span class="light fixedFont">{String}</span> The string updated with the variables you provided.</dd>
							
							</dl>
						
						
						

					<hr />
				
					<a name=".xhrLoad"> </a>
					<div class="fixedFont">&lt;static&gt; 
					
					<span class="light">{XMLHttpRequest}</span>
					<span class="light">pwlib.</span><b>xhrLoad</b>(url, handler, method, send, headers)
					
					</div>
					<div class="description">
						Load a file from a given URL using XMLHttpRequest.
						
						
					</div>
					
					
					
						
							<dl class="detailList">
							<dt class="heading">Parameters:</dt>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>url</b>
									
								</dt>
								<dd>The URL you want to load.</dd>
							
								<dt>
									<span class="light fixedFont">{Function}</span> <b>handler</b>
									
								</dt>
								<dd>The <code>onreadystatechange</code> event handler 
for the XMLHttpRequest object. Your event handler will always receive the 
XMLHttpRequest object as the first parameter.</dd>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>method</b>
									<i>Optional, Default: "GET"</i>
								</dt>
								<dd>The HTTP method to use for loading the URL.</dd>
							
								<dt>
									<span class="light fixedFont">{String}</span> <b>send</b>
									<i>Optional, Default: null</i>
								</dt>
								<dd>The string you want to send in an HTTP POST 
request.</dd>
							
								<dt>
									<span class="light fixedFont">{Object}</span> <b>headers</b>
									<i>Optional</i>
								</dt>
								<dd>An object holding the header names and values you 
want to set for the request.</dd>
							
							</dl>
						
						
						
						
							<dl class="detailList">
							<dt class="heading">Throws:</dt>
							
								<dt>
									<span class="light fixedFont">{TypeError}</span>  <b></b>
								</dt>
								<dd>If the <var>url</var> is not a string.</dd>
							
							</dl>
						
						
							<dl class="detailList">
							<dt class="heading">Returns:</dt>
							
								<dd><span class="light fixedFont">{XMLHttpRequest}</span> The XMLHttpRequest object created by this method.</dd>
							
							</dl>
						
						
						

					
				
			
			
<!-- ============================== event details ========================= -->		
			
			
			<hr />
		</div>

		
<!-- ============================== footer ================================= -->
		<div class="fineprint" style="clear:both">
			
			Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.0 on Sat Jun 26 2010 21:56:59 GMT+0300 (EEST)
		</div>
	</body>
</html>
